/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts.prepare;

import com.myapp.struts.beans.ReceiptsVoucherBean;
import java.sql.ResultSet;
import java.util.ArrayList;

/**
 *
 * @author pavan
 */
public class ReceiptsVoucherPrepareAL {

    ArrayList al = new ArrayList();

    public ArrayList prepareArrayList(ResultSet rs) {
        try {
            if (rs == null) {
            } // end of if
            else {
                while (rs.next()) {
                    ReceiptsVoucherBean ib = new ReceiptsVoucherBean();
                    ib.setReceipt_no(rs.getString(1));
                    ib.setReceipt_type(rs.getString(2));
                    ib.setReceipt_Date(rs.getString(4));
                    ib.setAccount_head(rs.getString(3));
                    ib.setNarration(rs.getString(6));
                    ib.setAmount(rs.getString(5));
                    al.add(ib);
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at InvoicePrepareAL" + e);
        }                         // end of catch

        return al;
    }
}
